<template>
  <div class="drawBox">
    <div class="cons" v-for="item in res.once" :key="item.id">
      <div class="d-info">
        <img :src="`https://ss.lanqb.com/${item.profile.avatar}`" alt="" />
        <p class="nickname">{{ item.profile.nickname }}</p>
      </div>
      <p class="content">{{ item.content }}</p>
      <div class="imgs">
        <img :src="`https://ss.lanqb.com/${item.works.url}`" alt="" />
      </div>
      <div class="icon">
        <div class="check">
          <van-icon name="eye-o" />
          <p class="nums">{{ item.statistics.hits_num }}</p>
        </div>
        <div class="check">
          <van-icon name="chat-o" />
          <p class="nums">{{ item.statistics.comment_num }}</p>
        </div>
        <div class="check">
          <van-icon name="like-o" />
          <p class="nums">{{ item.statistics.like_num }}</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { getCurrentInstance, reactive } from "vue";
const { $axios, $request } =
  getCurrentInstance().appContext.config.globalProperties;

// https://m.lanqb.com/api/works?type=3&is_commun_status=0&page=1
let res = reactive({
  once: [],
});
$axios(`/lanqb/api/works?type=3&is_commun_status=0&page=1`, "GET").then(
  ({ data }) => {
    res.once = data.data;
    // console.log(res.once);
  }
);
</script>

<style lang="less">
* {
  margin: 0;
  padding: 0;
}
.drawBox {
  width: 100vw;
  height: calc(100vh - 40px - 44px - 42px - 50px);
  overflow-y: scroll;
  padding: 0 15px;
  box-sizing: border-box;
  &::-webkit-scrollbar {
    display: none;
  }
  .cons {
    padding: 20px 0;
    border-bottom: 2px solid #eee;
    .d-info {
      display: flex;
      align-items: center;
      img {
        width: 32px;
        height: 32px;
        border-radius: 50%;
      }
      .nickname {
        margin-left: 15px;
        color: #000000;
        font-size: 15px;
      }
    }
    .content {
      margin-top: 10px;
      color: #3f4345;
      font-size: 15px;
    }
    .imgs {
      margin-top: 10px;
      height: 300px;
      img {
        max-width: 300px;
        height: 100%;
        border-radius: 10px;
      }
    }
    .icon {
      margin-top: 10px;
      display: flex;
      justify-content: space-between;
      padding: 0 25px;
      .check {
        display: flex;
        color: #5b6164;
        font-size: 14px;
        .nums {
          margin-left: 10px;
        }
      }
    }
  }
}
</style>
